import request from '@/utils/request'
export default {
    //查询所有菜品分类
    getAllCategory(){
        return request({
            url:'/ordermealservice/orderclassification/getAllCategory',
            method:'get'
        })
    },
    //新增菜品分类
    createCategory(orderClassification){
        return request({
            url:'/ordermealservice/orderclassification/createCategory',
            method:'post',
            data:orderClassification
        })
    },
    //新增菜品
    createDish(orderDish){
        return request({
            url:'ordermealservice/orderdish/createDish',
            method:'post',
            data:orderDish
        })
    },
    //查询一级菜品分类
    getCategory(){
        return request({
            url:'/ordermealservice/orderclassification/getCategory',
            method:'get'
        })
    },
    //查询二级菜品分类
    getSubCategory(category){
        return request({
            url:`/ordermealservice/orderclassification/getSubCategory/${category}`,
            method:'get'
        })
    },
    //带条件的分页查询(后台)
    selectPageByCondition(page,pageSize,dishSelectByConditionVO){
        return request({
            url:`/ordermealservice/orderdish/selectPageByCondition/${page}/${pageSize}`,
            method:'post',
            data: dishSelectByConditionVO
        })
    },
    //带条件的分页查询(前台)
    selectPageByConditionApi(page,pageSize,dishSelectByConditionVO){
        return request({
            url:`/ordermealservice/orderdishApi/selectPageByCondition/${page}/${pageSize}`,
            method:'post',
            data: dishSelectByConditionVO
        })
    },
    // 批量删除菜品
    deleteDish(ids){
        return request({
            url:"/ordermealservice/orderdish/deletedish",
            method:'delete',
            params: {ids:ids}
        })
    },
    //修改菜品状态
    editStatus(id){
        return request({
            url:`/ordermealservice/orderdish/editStatus/${id}`,
            method:'post'
        })
    },
    //菜品回显
    selectDish(dishId){
        return request({
            url:`/ordermealservice/orderdish/selectDish/${dishId}`,
            method:'get'
        })
    },
    //修改菜品信息
    editDish(dish){
        return request({
            url:'/ordermealservice/orderdish/editDish',
            method:'post',
            data:dish
        })
    }
}